import hospital_top from './hospital_top/index.vue'
import hospital_bottom from './hospital_bottom/index.vue'
import Filterate from './Filterate/index.vue'
import hospital_card from './hospital_card/index.vue'
import SvgIcon from './SvgIcon/index.vue'
import Login from './Login/index.vue'
import doc_card from './doc_card/index.vue'

import type { Component, App } from 'vue'

// 全局组件对象
const allGloablComponents: {
  [key: string]: Component
} = {
  hospital_top,
  hospital_bottom,
  Filterate,
  hospital_card,
  SvgIcon,
  Login,
  doc_card,
}

// element-icon 图标引入
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

export default {
  install(app: App) {
    Object.keys(allGloablComponents).forEach((key) => {
      app.component(key, allGloablComponents[key])
    })

    // 注册element-icon 图标
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
